package Practice.P01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Practice02 {
    public static void main(String[] args) {
        // 概率点名
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,1,1,1,1,1,1,1);
        Collections.addAll(list,0,0,0);
        Collections.shuffle(list);
        Random r = new Random();
        int index = r.nextInt(list.size());
        int number = list.get(index);
        // 男生集合
        ArrayList<String> manList = new ArrayList<>();
        Collections.addAll(manList,"男一号","男二号","男三号","男四号","男五号","男六号");
        // 女生集合
        ArrayList<String> girlList = new ArrayList<>();
        Collections.addAll(girlList,"女一号","女二号","女三号","女四号","女五号","女六号");
        if (number == 1){
            int manIndex = r.nextInt(manList.size());
            String name = manList.get(manIndex);
            System.out.println(name);
        }else {
            int girlIndex = r.nextInt(girlList.size());
            String name = girlList.get(girlIndex);
            System.out.println(name);
        }

    }
}
